<?php  echo('<meta http-equiv="refresh" content="'.$timeTesst.'">');?>
<div class="contests" style="background:url('../img/<?php echo 'bg'.$data['Orther']['bg']?>.jpg') no-repeat;">
    <div class="col-xs-12 col-sm-12">
            <?php  //echo $datas['bottom'];
            if($data['Question']){ ?>
            <div class="data-contensts">
                <div class="contenst-title">
                        <!--h5 class="color-text">BÁO CÁO VIÊN : <?php //echo $data['Orther']['name']; ?></h5-->
                        <h5 class="color-text1" style="text-transform:uppercase;">Pharmacovigilance<?php //echo $data['Orther']['usemame']; ?></h5>
                </div>
                <div class="border-bottom"></div>
                <form action = "" method="post">
                <div class="question-data">
                        <p class="title-question"> Câu hỏi số <?php echo $data['Question']['order'];?> : </p>
                         <input type="hidden" name="nextOder" value="<?php $next=$data['Question']['order']+1; echo $next;?>"/> 
                         <input type="hidden" name="idQuest" value="<?php echo $data['Question']['id']; ?>"/> 
                         <input type="hidden" name="end" value="<?php echo $data['Question']['end']; ?>"/> 
                      <span style="font-size:20px; color:#999">  <?php echo $data['Question']['name'] ?></span>
                        <div class="content-question">
                            <div>
                                <center>	
                                <ul class="nav nav-pills">
                                        <?php 
                                        $arr =  array('1'=>'A','2'=>'B','3'=>'C','4'=>'D','5'=>'E','6'=>'F');

                                        if($data['Answer']):
                                        $i=1;
                                        foreach($data['Answer'] as $an): ?>
                                          <li>&nbsp;
                                              <input style="float:left; margin-left:10px;" id="CategoryType<?php echo $i;?>" type="radio" name="ruleAn" value="<?php echo $an['Answer']['id'];?>" <?php if($i==1){?> checked="true"<?php }?> >
                                              <label style="width:80%; float:left;text-align:left; cursor:pointer;font-weight:normal" for="CategoryType<?php echo $i ?>">&nbsp;<?php  echo $arr[$i]?>. &nbsp;<?php echo $an['Answer']['name'] ?> </label></li>
                                         <?php $i++;
                                         endforeach; 
                                         endif;
                                         ?>
                                </ul>
                                </center>
                                
                                <div style="margin-top:20px;">
                                    <center>
                                        <button type="submit" class="btn btn-primary">&nbsp;&nbsp; XÁC NHẬN &nbsp;&nbsp;</button>
                                    </center>
                                </div>	
								 <p id="show" style="float:right;color:red;"></p>	
                            </div>
                        </div>
                </div>
                </form >

        </div>
        <?php }?>
    </div>
</div> 
<script >
    var i=<?php echo $timeTesst ?>;// la số thời gian tối đa. ở đây mình cho nó chạy từ 1 tới 100
    function time()
    {
        if(i>=0)
        {
            document.getElementById("show").innerHTML="Thời gian còn lại là: "+i+" giây";
            i--;
            setTimeout("time()",1000);
        }
        else
        {
            // gọi các hàm cần thực hiện ở đây
           // alert(" Đã Đếm Ngược Xong từ 100 về 0");
        }
    }
    
</script> 	
